﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Module_TopNews.ascx.cs" Inherits="Modules_Module_TopNews" %>

       
            <asp:Label ID="Label1" runat="server" Text="新闻公告" Width="600px" 
                BackColor="#336699">
            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/page2.aspx" 
                Width="500px"  style="text-align:right">more...</asp:HyperLink>
</asp:Label>

        <asp:GridView ID="GridView1" runat="server" 
    AutoGenerateColumns="False" DataSourceID="SqlDataSource1" Width="600px" 
    BackColor="White" GridLines="None" PageSize="3">
            <Columns>
                <asp:BoundField DataField="id" HeaderText="id" ReadOnly="True">
                 <HeaderStyle HorizontalAlign="Left" Width="10px"  CssClass="hidden"/>
                    <ItemStyle HorizontalAlign="Left" Width="10px"  CssClass="hidden"/>
                </asp:BoundField>
                
                
               <asp:TemplateField HeaderText="标题">
                 <HeaderStyle HorizontalAlign="Left" Width="400px" />
                 <ItemStyle HorizontalAlign="Left" Width="400px" />
                <ItemTemplate>
                     <a href='./News_Show.aspx?NewsID=<%# Eval("id") %>' title='<%#Eval("id") %>' target="_self" >
                              <%# Eval("title") %></a><br />                                            
                </ItemTemplate>
               </asp:TemplateField>
                       
                <asp:BoundField DataField="publishtime" HeaderText="发布时间"
                                 DataFormatString="{0:yyyy/MM/dd}" >
             
                    <HeaderStyle HorizontalAlign="Right" Width="200px" />
                    <ItemStyle HorizontalAlign="Right" Width="200px" />
                </asp:BoundField>
             
            </Columns>
            <HeaderStyle  cssClass="hidden"/>
            <AlternatingRowStyle BackColor="#99CCFF" Wrap="False" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:allshareConnectionString3 %>" 
    ProviderName="<%$ ConnectionStrings:allshareConnectionString3.ProviderName %>" 
    SelectCommand="SELECT * FROM news WHERE isTop=1 AND enable=1 ORDER BY publishtime DESC LIMIT 5">
</asp:SqlDataSource>


